SPB Git

Repository Public

layout.tsx 4.0 KB 93 lines tsx

1/**2 * =============================================================================3 *                  SP BOUCHER | SOFTWARE & RESEARCH4 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project          : ORIX App Universe8 * File             : src/app/[locale]/layout.tsx9 * Module           : app10 * Repository       : https://git.spboucher.ai/orix-spboucher-ai11 * Project Website  : https://www.orixlab.dev12 * Created          : 2026-11-2113 * Last Modified    : 2026-11-2114 *15 * Author           : Simon-Pierre Boucher16 * Position         : Professor of Finance17 * Institution      : Université du Québec en Outaouais (UQO)18 * Organization     : SP Boucher19 * Website          : https://spboucher.ai20 * Git              : https://git.spboucher.ai21 *22 * Preferred Contact: support@spboucher.ai23 * Development      : dev@spboucher.ai24 * Support          : support@spboucher.ai25 * Security/Admin   : admin@spboucher.ai26 *27 * Copyright (c) 202628 * Simon-Pierre Boucher29 * All rights reserved where applicable. This file is governed by the30 * applicable project license, copyright notices and relevant law.31 * Existing third-party rights and notices remain unaffected.32 *33 * License          : None specified (no license file in this repository)34 *35 * Do not embed credentials, private keys, access tokens,36 * certificates or confidential personal information.37 *38 * =============================================================================39 * END OF SP BOUCHER SOURCE HEADER40 * =============================================================================41 */4243import type { Metadata, Viewport } from "next";44import { notFound } from "next/navigation";45import "../globals.css";46import { Header } from "@/components/layout/Header";47import { Footer } from "@/components/layout/Footer";48import { Spotlight } from "@/components/ui/Spotlight";49import { listApps } from "@/lib/catalog";50import { dict, HTML_LANG, isLocale } from "@/lib/i18n";51import { env } from "@/lib/env";5253export const dynamic = "force-dynamic";5455export const viewport: Viewport = { themeColor: [{ media: "(prefers-color-scheme: dark)", color: "#06070a" }, { media: "(prefers-color-scheme: light)", color: "#f5f5f2" }], width: "device-width", initialScale: 1 };5657export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }): Promise<Metadata> {58  const { locale } = await params;59  const t = dict(isLocale(locale) ? locale : "en");60  return {61    metadataBase: new URL(env.publicUrl),62    title: { default: `ORIX — ${t.brand.tagline}`, template: "%s — ORIX" },63    description: t.hero.body,64    applicationName: "ORIX",65    authors: [{ name: "Simon-Pierre Boucher", url: "https://www.spboucher.ai" }],66    openGraph: { siteName: "ORIX", type: "website", locale: locale === "fr" ? "fr_CA" : "en_CA" },67    twitter: { card: "summary_large_image" },68    formatDetection: { telephone: false },69  };70}7172// Applies the stored appearance before first paint (no flash); also lets CSS know scripts run.73const boot = `try{var t=localStorage.getItem("orix-theme");if(t==="light"||t==="dark")document.documentElement.dataset.theme=t}catch(e){}document.documentElement.classList.remove("no-js")`;7475export default async function LocaleLayout({ children, params }: { children: React.ReactNode; params: Promise<{ locale: string }> }) {76  const { locale } = await params;77  if (!isLocale(locale)) notFound();78  const t = dict(locale);79  const apps = listApps().map((r) => ({ slug: r.slug, name: r.app.name }));80  return (81    <html lang={HTML_LANG[locale]} className="no-js" suppressHydrationWarning>82      <head><script dangerouslySetInnerHTML={{ __html: boot }} /></head>83      <body>84        <a href="#main" className="btn btn-primary fixed left-4 top-4 z-[100] -translate-y-24 focus:translate-y-0">{t.brand.skip}</a>85        <Header locale={locale} labels={t.nav} />86        <main id="main">{children}</main>87        <Footer locale={locale} apps={apps} />88        <Spotlight />89      </body>90    </html>91  );92}93
Files main
Menu

Theme